#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int c[10][3005];
void solve(int a, int b) {
  cout << a << '/' << b << " = ";

  vector<int> ans;
  int l = -1;
  rep(i, 0, 9) rep(j, 0, 3000) c[i][j] = 0;

  ans.push_back(a / b);
  a %= b;
  while (true) {
    if (a == 0) {
      ans.push_back(0);
      l = ans.size() - 1;
      break;
    }
    a *= 10;
    int x = a / b;
    a = a % b;
    if (c[x][a]) {
      l = c[x][a];
      break;
    } else {
      ans.push_back(x);
      c[x][a] = ans.size() - 1;
    }
  }

  int len = ans.size() - l;
  cout << ans[0] << '.';
  rep(i, 1, l - 1) cout << ans[i];
  cout << '(';
  if (len <= 50)
    rep(i, l, ans.size() - 1) cout << ans[i];
  else {
    rep(i, l, l + 49) cout << ans[i];
    cout << "...";
  }
  cout << ")\n";
  cout << "   " << len << " = number of digits in repeating cycle\n";
  cout << endl;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int a, b;
  int id = 0;
  while (cin >> a >> b) {
    solve(a, b);
  }
  return 0;
}